<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class search_model extends WST_Model {
	private $_table = "post";

	function find_all($keyword){
		$this->db->where('MATCH (name,content) AGAINST ("'.$keyword.'") >0',null,false);
		$query = $this->db->get($this->_table);
        return $query->result_array();
	}

	function count_all($keyword){
		$this->db->where('MATCH (name,content) AGAINST ("'.$keyword.'") >0',null,false);
		return $this->db->count_all($this->_table);
	}

}
